package util;

import dao.UserDAO;
import dao.UserDaoJdbcImpl;
import modle.users;

public class InterCheck {
	public static users interCheck(String na, String pw) {
		System.out.println("::::::::::interCheck:::::::::");
		UserDAO usd = new UserDaoJdbcImpl();
		users user = usd.readUser(na);
		try {
			if( user != null ) {
				if( pw.equals( user.getPassword() ) ) {
					System.out.println("账号密码正确");
					return user;
				}
			}
		} catch (Exception e) {
			return null;
		}
		return null;
	}
}
